<?php
class ModulePrivilegeUserVo extends SzAbstractMySqlVo
{

    private $userId;
    private $name;
    private $email;
    private $username;
    private $password;
    private $roleId;
    private $created;

    /**
     * Initialize ModulePrivilegeUserVo.
     *
     * @param $userId
     * @param $name
     * @param $email
     * @param $username
     * @param $password
     * @param $roleId
     * @param $created
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return ModulePrivilegeUserVo
     */
    public function __construct($userId, $name, $email, $username, $password, $roleId, $created, $isInsert = false) {
        $this->userId = $userId;
        $this->name = $name;
        $this->email = $email;
        $this->username = $username;
        $this->password = $password;
        $this->roleId = $roleId;
        $this->created = $created;

        $this->isInsert = $isInsert;
        $this->voClassName = 'ModulePrivilegeUserVo';
        $this->ormName = 'ModulePrivilegeUser';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'name' => $this->getName(),
            'email' => $this->getEmail(),
            'username' => $this->getUsername(),
            'password' => $this->getPassword(),
            'roleId' => $this->getRoleId(),
            'created' => $this->getCreated(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'name' => $this->getName(),
            'email' => $this->getEmail(),
            'username' => $this->getUsername(),
            'password' => $this->getPassword(),
            'roleId' => $this->getRoleId(),
            'created' => $this->getCreated(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getName(),
            $this->getEmail(),
            $this->getUsername(),
            $this->getPassword(),
            $this->getRoleId(),
            $this->getCreated(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($val)
    {
        $this->saveColumnStatus(1, $this->name);
        $this->name = $val;
    }

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($val)
    {
        $this->saveColumnStatus(2, $this->email);
        $this->email = $val;
    }

    public function getUsername()
    {
        return $this->username;
    }

    public function setUsername($val)
    {
        $this->saveColumnStatus(3, $this->username);
        $this->username = $val;
    }

    public function getPassword()
    {
        return $this->password;
    }

    public function setPassword($val)
    {
        $this->saveColumnStatus(4, $this->password);
        $this->password = $val;
    }

    public function getRoleId()
    {
        return $this->roleId;
    }

    public function setRoleId($val)
    {
        $this->saveColumnStatus(5, $this->roleId);
        $this->roleId = $val;
    }

    public function getCreated()
    {
        return $this->created;
    }

    public function setCreated($val)
    {
        $this->saveColumnStatus(6, $this->created);
        $this->created = $val;
    }

    public function setPropertyValue($propertyName, $val)
    {
        $func = "set{$propertyName}";
        return $this->$func($val);
    }
}